package com.btl.service.ai.auth;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * 线程上下文
 */
public class SecurityContextHolder {
    private static final TransmittableThreadLocal<ChildUser> THREAD_LOCAL = new TransmittableThreadLocal<>();

    public static void set(ChildUser user) {
        THREAD_LOCAL.set(user);
    }

    public static ChildUser get() {
        return THREAD_LOCAL.get();
    }

    public static void remove() {
        THREAD_LOCAL.remove();
    }
}
